package baseTypeTest

import (
	"fmt"
	"reflect"
)

func Open() {
	arraySliceTest()
}

func arraySliceTest() {
	x := [3]int{1, 2, 3}
	y := [...]string{}
	z := make([]int, 0)
	testType(x, y, z)
}

func testType(arg ...interface{}) {
	for _, v := range arg {
		t := reflect.TypeOf(v)
		if t.Kind() == reflect.Slice || t.Kind() == reflect.Array || t.Kind() == reflect.Ptr {
			fmt.Println(t.Elem())
		}
	}
	fmt.Println("-----valueT----")
	for _, v := range arg {
		modelType := reflect.ValueOf(v).Type()
		if modelType.Kind() == reflect.Slice || modelType.Kind() == reflect.Array || modelType.Kind() == reflect.Ptr {
			fmt.Println(modelType.Elem())
		}
	}
}
